<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>加载动画</title>
    <style>
      /* 全局样式重置 */
      * {
        margin: 0;
        padding: 0;
        box-sizing: border-box;
      }
      /* 设置body的样式 */
      body {
        min-height: 100vh;
        display: flex;
        justify-content: center;
        align-items: center;
        background-color: #000c18;
      }
      /* 加载动画样式 */
      .loader {
        width: 50px;
        height: 50px;
        border-radius: 50%;
        display: inline-block;
        position: relative;
        border: 10px solid transparent; /* 优化：使用transparent代替rgba(255, 255, 255, 0) */
        box-sizing: border-box;
        animation: rotating 1.5s ease-in-out infinite; /* 调整动画时间和缓动函数 */
      }
      /* 旋转动画关键帧 */
      @keyframes rotating {
        0% {
          transform: rotate(0deg);
          border-color: #ffff00 transparent transparent transparent;
        }
        12.5% {
          transform: rotate(45deg);
          border-color: #ffff00 #ffff00 transparent transparent;
        }
        25% {
          transform: rotate(90deg);
          border-color: #ffff00 #ffff00 transparent transparent;
        }
        37.5% {
          transform: rotate(135deg);
          border-color: #ffff00 #ffff00 #ffff00 transparent;
        }
        50% {
          transform: rotate(180deg);
          border-color: #ffff00 #ffff00 #ffff00 transparent;
        }
        62.5% {
          transform: rotate(225deg);
          border-color: #ffff00 #ffff00 #ffff00 #ffff00;
        }
        75% {
          transform: rotate(270deg);
          border-color: #ffff00 #ffff00 #ffff00 #ffff00;
        }
        87.5% {
          transform: rotate(315deg);
          border-color: #ffff00 #ffff00 #ffff00 #ffff00;
        }
        100% {
          transform: rotate(360deg);
          border-color: #ffff00 transparent transparent transparent;
        }
      }
    </style>
  </head>
  <body>
    <!-- 加载动画元素 -->
    <span class="loader"></span>
  </body>
</html>
